/**
 * 
 */
package it.gommonauti.patenti.entity;

/**
 * @author Francesco Stallone ( f.stallone73@gmail.com ).
 * 
 * A subquestion  of a MainQuestion.
 *
 */
public class SubQuestion {

	/**
	 * SubQuestion identifier.
	 */
	private int id;
	
	/**
	 * Sub question description
	 */
	private String description;
	
	/**
	 * The main question.
	 * Using composite pattern.
	 */
	private MainQuestion parent;
	
	/**
	 * Sub question language.
	 */
	private Language language;
	
	/**
	 * The sub question response.
	 */
	private boolean response;
	
	/**
	 * User response
	 */
	private UserResponse userResponse;
	
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the parent
	 */
	public MainQuestion getParent() {
		return parent;
	}

	/**
	 * @param parent the parent to set
	 */
	public void setParent(MainQuestion parent) {
		this.parent = parent;
	}

	/**
	 * @return the language
	 */
	public Language getLanguage() {
		return language;
	}

	/**
	 * @param language the language to set
	 */
	public void setLanguage(Language language) {
		this.language = language;
	}

	/**
	 * @return the response
	 */
	public boolean isResponse() {
		return response;
	}

	/**
	 * @param response the response to set
	 */
	public void setResponse(boolean response) {
		this.response = response;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		
		sb.append("ID " + this.id + System.getProperty("line.separator"));
		
		sb.append("DESCRIPTION " + this.description + System.getProperty("line.separator"));
		
		sb.append("RESPONSE " + this.response + System.getProperty("line.separator"));
		
		return sb.toString();
	}

	/**
	 * @return the userResponse
	 */
	public UserResponse getUserResponse() {
		return userResponse;
	}

	/**
	 * @param userResponse the userResponse to set
	 */
	public void setUserResponse(UserResponse userResponse) {
		this.userResponse = userResponse;
	}
	
}
